package com.gz.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gz.common.RedisConst;
import com.gz.entity.BookType;
import com.gz.service.BookTypeService;
import com.gz.mapper.BookTypeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 龙龙与贝儿
* @description 针对表【t_book_type】的数据库操作Service实现
* @createDate 2025-05-12 17:00:39
*/
@Service
public class BookTypeServiceImpl extends ServiceImpl<BookTypeMapper, BookType>
    implements BookTypeService{

    @Autowired
    BookTypeMapper bookTypeMapper;
    @Override
//    @Cacheable(cacheNames = RedisConst.BOOK_TYPE_LIST, key= "#root.methodName")
    //keyGenerator包含，所在类：方法名：参数
    @Cacheable(cacheNames = RedisConst.BOOK_TYPE_LIST, keyGenerator= "keyGenerator")
    public List<BookType> findAll() {
        return this.list();
    }
}




